<template>
  <div class="warp" @click="close" v-if="show">
    <div class="share-con">
      <div class="title">{{config.title}}</div>
      <div class="btn-group">
        <button class="close btn-reset close" @click="clickEvent('cancle')">取消</button>
        <button class="close btn-reset share" open-type="share" @click="clickEvent('success')">分享</button>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: ['config'],
  data () {
    return {
      show: this.config.show
    }
  },
  methods: {
    close () {
      this.show = false
    },
    clickEvent (res) {
      this.show = false
    }
  }
}
</script>

<style lang="stylus" scoped>
  .warp {
    position: fixed
    left: 0
    right: 0
    top: 0
    bottom: 0
    background: rgba(0,0,0,0.6)
  }
  .share-con {
    width: 600rpx
    color: #131313
    background: #fff
    margin: 50% auto 0 auto
    transform: translateY(-50%)
    .title {
      height: 180rpx
      padding: 0 20rpx
      line-height: 180rpx
      text-align: center
      font-size: 28rpx
      box-sizing: border-box
    }
    .btn-group {
      overflow: hidden
      border-top: 1px solid #ccc
      button {
        width: 50%
        float: left
        height: 100rpx
        font-size: 30rpx
        text-align: center
        line-height: 100rpx
      }
      .share {
        color: #1AAD16
        border-left: 1px solid #ccc
      }
    }
  }
</style>
